# $Id$
# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Michael Baehr <usemike@spamblocked.com>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - using source from Ubuntu Natty, 1.10+cvs20100619-2build1
#  - use pic with v6 and v7

pkgname=ffcall
pkgver=1.10
pkgrel=6
pkgdesc="C library for implementing foreign function calls in embedded interpreters"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/libffcall/"
license=('GPL2')
options=('!makeflags' 'staticlibs')
source=(http://archlinuxarm.org/builder/src/${pkgname}-${pkgver}.tar.gz)
md5sums=('700e91d12c2fddf3aa4090436ce28370')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  [ "$CARCH" = "x86_64" ] && CONFIGFLAG="--with-pic"
  [ "$CARCH" = "armv6h" -o "$CARCH" = "armv7h" ] && CONFIGFLAG="--with-pic"
  ./configure --prefix=/usr --mandir=/usr/share/man $CONFIGFLAG
  make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  install -d "${pkgdir}"/usr/share/{man,doc/ffcall}
  make DESTDIR="${pkgdir}" htmldir=/usr/share/doc/ffcall install
}
